home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
gnudev1.zip
/
emx
/
doc
/
emxgnu.doc
< prev
next >
Wrap
Text File
|
1996-09-08
|
59KB
|
1,704 lines
===============================================================================
emxgnu.doc emx 0.9c GNU DEVELOPMENT TOOLS INFORMATION 09-Sep-1996
===============================================================================
Copyright (c) 1990-1996 by Eberhard Mattes
Table of Contents
=================
1 Introduction to GNU Development Tools Information
2 GCC -- compiling and linking C and C++ programs
2.1 Calling GCC
2.2 Environment variables
2.3 Bounds checking
2.4 #pragma statement
2.5 Additional command line options
2.5.1 -mepilogue
2.5.2 -mprobe
2.5.3 -pn
2.5.4 -Zbin-files
2.5.5 -Zbsd-signals
2.5.6 -Zcrtdll
2.5.7 -Zdll
2.5.8 -Zexe
2.5.9 -Zlinker
2.5.10 -Zmap
2.5.11 -Zmt
2.5.12 -Zmtd
2.5.13 -Zmts
2.5.14 -Zno-rte
2.5.15 -Zomf
2.5.16 -Zsmall-conv
2.5.17 -Zstack
2.5.18 -Zso
2.5.19 -Zsys
2.5.20 -Zsysv-signals
2.6 Special file extensions
2.7 Startup modules and libraries
2.8 Assertions
2.9 C++
2.10 Objective C
2.11 Stack probes
2.12 Other changes
2.13 Calling conventions
3 libg++ -- the GNU C++ library (gpp.a and gpp.lib)
4 libstdc++ -- the GNU standard C++ library
5 GDB -- debugging programs
5.1 Example
5.2 Restrictions
5.3 Special features
5.3.1 Setting command line arguments for the program being debugged
5.3.2 Running the debuggee in the same window
5.3.3 Switching sessions
5.3.4 Closing the window after termination of the debuggee
5.3.5 Debugging threads
5.3.6 Debugging DLLs
5.3.7 Debugging descendant processes
5.3.8 Examining the heap
5.3.9 Initialization file
5.3.10 DUEL
5.3.11 GDBRX -- use REXX in GDB
5.4 Hints
6 GAS -- assembling
7 ld -- linking
8 ranlib
9 strip -- removing the symbol table
10 info -- browsing info files
11 makeinfo -- creating info files
12 texindex -- creating the index for a printed manual
13 termcap -- terminal capabilities
14 readline
15 GPPDEMID -- an identifier manipulation DLL for G++
16 Known problems
1 Introduction to GNU Development Tools Information
===================================================
This text describes how to use the GNU C Compiler and other GNU
utilities with emx. See emxdev.doc for instructions for the emx
utilities. For detailed information about GCC, GDB, and GAS, read the
GCC, GDB, and GAS manuals, see install.doc. See build.doc for details
on compiling the GNU utilities.
All programs assume that the entire package is installed on one disk
drive in these directories:
/emx/bin Executable files
/emx/etc termcap.dat
/emx/lib Library files
/emx/include Header files (C language)
/emx/include/cpp Header files (C++ language)
/emx/include/objc Header files (Objective C language)
If the /emx directory is not on the current drive, use the
C_INCLUDE_PATH and LIBRARY_PATH environment variables, for instance
set C_INCLUDE_PATH=c:/emx/include
set LIBRARY_PATH=c:/emx/lib
to use drive C.
Use forward slashes instead of backward slashes in path names!
Directories:
/emx Main directory, empty
/emx/bin Executable files and batch files
/emx/dll Dynamic link libraries
/emx/doc Documentation
/emx/etc termcap.dat
/emx/gnu/binutils.old old GNU binary utilities (sources)
/emx/gnu/binutils.26 new GNU binary utilities (sources)
/emx/gnu/doc Documentation
/emx/gnu/duel DUEL (for GDB)
/emx/gnu/gas-2.6 GNU assembler source (GAS)
/emx/gnu/gcc-2.7 GNU C compiler source (GCC)
/emx/gnu/gdb-4.16 GNU debugger source (GDB)
/emx/gnu/gppdemid C++ demangler for LINK386
/emx/gnu/info GNU info source
/emx/gnu/libtxi -libtxi (for GNU info)
/emx/gnu/libg++-2.7.2 GNU C++ libraries
/emx/gnu/makeinfo GNU makeinfo source
/emx/gnu/termcap GNU termcap
/emx/gnu/texindex GNU texindex source
/emx/include header files (C language)
/emx/include/cpp Header files (C++ language)
/emx/include/objc Header files (Objective C language)
/emx/lib Libraries
2 GCC -- compiling and linking C and C++ programs
=================================================
GCC 2.7.2.1 has been ported to emx, including Richard W.M. Jones's
bounds checking patches.
2.1 Calling GCC
---------------
For small projects, one invokation GCC can be used to compile and link
the program. Example:
gcc dwim.c
This assumes that emxl.exe can be found in one of the directories
listed in the EMXPATH and PATH environment variables, or in the
directory /emx/bin, see also ld. If no output file name is given, the
name of the first input file, with .exe extension (or .dll extension
if -Zdll is given), is used for the output file unless linking is
suppressed (with the -c option, for instance). That is, the above
example creates dwim.exe.
Please note that the example given above creates a file named dwim
which will be deleted after conversion to .exe format.
If the output file name doesn't end in .exe or .dll, the output file
will have a.out format (however, see -Zexe). Example:
gcc -o dwim dwim.c
This example creates the a.out file `dwim'.
2.2 Environment variables
-------------------------
If you want to develop programs on a drive different from the drive
where emx is installed, you have to set the C_INCLUDE_PATH and
LIBRARY_PATH environment variables, for instance,
set C_INCLUDE_PATH=c:/emx/include
set LIBRARY_PATH=c:/emx/lib
If you want to compile C++ programs, set CPLUS_INCLUDE_PATH as well:
set CPLUS_INCLUDE_PATH=c:/emx/include/cpp;c:/emx/include
If you want to compile Objective C programs, set OBJC_INCLUDE_PATH as
well:
set OBJC_INCLUDE_PATH=c:/emx/include
The genclass utility needs the following environment variable:
set PROTODIR=c:/emx/include/cpp/gen
If the TMPDIR, TMP and TEMP environment variables are not set, GCC
writes temporary files in the current working directory. GCC tries
TMPDIR, TMP and TEMP in turn and uses the first valid one. Note that
c: is not a valid directory name, you have to use c:/ or \ instead.
In other cases, a trailing slash or backslash is optional. For
instance, use
SET TMPDIR=f:/tmp/
to put temporary files into the f:/tmp directory.
When compiling projects consisting of many modules (such as libraries)
under OS/2, you can speed up compilation if you have enough memory by
keeping GCC in memory. For example, to keep GCC in memory for 5
minutes, use
set GCCLOAD=5
The following programs use GCCLOAD: gcc.exe, cpp.exe, cc1.exe,
cc1plus.exe, cc1obj.exe, as.exe and emxomf.exe.
You can put GCC options into the environment variable GCCOPT. These
options will be read before the options given on the command line.
For example, to use -pipe, type
set GCCOPT=-pipe
2.3 Bounds checking
-------------------
The emx port of GCC includes Richard W.M. Jones's bounds checking
patches. See the GCC manual and \emx\gnu\doc\bounds\README for
details. The complete report is in \emx\gnu\doc\bounds\bcrep2.ps
(shipped in gnudoc.zip). Use GhostScript if you don't have a
PostScript printer. \emx\gnu\doc\bounds\bcreport.txt contains
important excerpts from an earlier version of the report as plain
ASCII text.
There are a few additional restrictions under OS/2:
- Bounds checking is not available for multit